import os

import django

DEBUG = True
DEBUG_PROPAGATE_EXCEPTIONS = True

ADMINS = ()
MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'db.sqlite3',
    }
}

# LANGUAGE_CODE = 'zh-Hans'

# TIME_ZONE = 'Asia/Shanghai'
TIME_ZONE = 'Europe/Riga'

SITE_ID = 1

USE_I18N = True
USE_L10N = True

MEDIA_ROOT = ''
SECRET_KEY = 'vaO4Y<g#YRWG8;Md8noiLp>.w(w~q_b=|1`?9<x>0KxA%UB!63'

MEDIA_URL = ''

MIDDLEWARE = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
]

if django.VERSION < (1, 10):
    MIDDLEWARE_CLASSES = MIDDLEWARE + [
        'django.contrib.auth.middleware.AuthenticationMiddleware',
    ]
else:
    MIDDLEWARE += [
        'django.middleware.security.SecurityMiddleware',
    ]

ROOT_URLCONF = 'suit3.tests.urls'

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'suit3',
    'suit3.tests',
    'suit3.tests.templatetags',
    'django.contrib.admin',
)

STATIC_URL = '/static/'

try:
    from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP

    TEMPLATE_DEBUG = DEBUG

    TEMPLATE_LOADERS = (
        'django.template.loaders.filesystem.Loader',
        'django.template.loaders.app_directories.Loader',
    )

    TEMPLATE_DIRS = ()

    TEMPLATE_CONTEXT_PROCESSORS = list(TCP) + [
        'django.core.context_processors.request',
    ]
except ImportError:  # Django 1.9+
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    'django.template.context_processors.debug',
                    'django.template.context_processors.request',
                    'django.contrib.auth.context_processors.auth',
                    'django.contrib.messages.context_processors.messages',
                ],
            },
        },
    ]

# SUIT_CONFIG = {}
TEST_RUNNER = 'suit3.tests.SuitTestRunner'
STATIC_ROOT = os.path.join('.', 'static')

STATIC_URL = '/static/'

SUIT_CONFIG = {
    # header
    'ADMIN_NAME': '内容管理系统',
    'HEADER_DATE_FORMAT': 'Y F j l',
    'HEADER_TIME_FORMAT': 'Y-m-d H:i',

    # forms
    'SHOW_REQUIRED_ASTERISK': True,  # Default True
    'CONFIRM_UNSAVED_CHANGES': True,  # Default True

    # menu
    # 'SEARCH_URL': '/admin/auth/user/',
    # 'MENU_ICONS': {
    #     'sites': 'icon-leaf',
    #     'auth': 'icon-lock',
    # },
    # 'MENU_OPEN_FIRST_CHILD': True,  # Default True
    # # 'MENU_EXCLUDE': ('auth.group',),
    # # 'MENU': (
    # #     'sites',
    # #     {'app': '认证', 'icon': 'icon-lock', 'models': ('user', 'group')},
    # #     {'label': '资源管理', 'icon': 'icon-cog', 'models': ('restful.restauth', 'restful.stars','restful.brand')},
    # #     {'label': '设置', 'icon': 'icon-cog', 'models': ('auth.user', 'auth.group')},
    # #     {'label': '支持', 'icon': 'icon-question-sign', 'url': '/admin/doc/'},
    # # ),
    #
    # # misc
    # 'LIST_PER_PAGE': 15,
}
